Skip to content

refactor: replace hardcoded 'en' defaults with LIBRARY_DEFAULT_LOCALE#13

Merged
ErnestM1234 merged 4 commits intogeneraltranslation:mainfrom
moss-bryophyta:refactor/use-library-default-locale
Mar 7, 2026
Merged

refactor: replace hardcoded 'en' defaults with LIBRARY_DEFAULT_LOCALE#13
ErnestM1234 merged 4 commits intogeneraltranslation:mainfrom
moss-bryophyta:refactor/use-library-default-locale

Conversation

@moss-bryophyta
Copy link
Contributor

Replace all hardcoded "en" locale defaults in source code with the existing LIBRARY_DEFAULT_LOCALE constant from generaltranslation._settings.

This ensures there's a single source of truth for the default locale across all packages:

  • gt-fastapi and gt-flask setup functions
  • Locale name, region properties, locale properties, plural form, and validation helpers
  • Formatting helpers
  • generaltranslation-intl-messageformat formatter

No behavioral change — LIBRARY_DEFAULT_LOCALE is already defined as "en".

The intl-messageformat package doesn't depend on generaltranslation,
so importing from generaltranslation._settings would break standalone
installs. Define the constant locally instead.
@ErnestM1234 ErnestM1234 merged commit 3db6998 into generaltranslation:main Mar 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants